#include <QtGui/QApplication>

#include "Configuration.h"
#include "ServerChecker.h"
#include "ServerManager.h"
#include "MainWindow.h"

int main( int argc, char *argv[] )
{
    QApplication a( argc, argv );
    a.setApplicationName( "Still There" );
    a.setOrganizationName( "tea2code" );

    // Configuration.
    Configuration configuration;
    configuration.load();
    int checkInterval = configuration.checkInterval();

    // Model.
    ServerChecker serverChecker( checkInterval );
    ServerManager serverManager( &serverChecker );
    serverManager.loadServers();

    // View.
    MainWindow mainWindow( &configuration, &serverManager );
    mainWindow.show();

    // Start checks.
    serverManager.start();
    
    return a.exec();
}
